<%@page contentType="text/html; charset=UTF-8"%>
<%@page import="model.Povlastica"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<jsp:useBean id="user" class="model.User" scope="session" />
<jsp:useBean id="povl" class="model.Povlastica" scope="session" />

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Pregled povlastice</title>
</head>
<body>

<h1>Pregled povlastice</h1>
<br>
<%
	if (user != null && user.isLoggedIn()) {
%>

<table cellspacing=0 cellpadding=3 border=0>
	<!-- 
	<tr>
		<td align=right>Sifra:</td>
		<td><c:out value="${povl.sifra.id}" /></td>
	</tr>
 -->
	<tr>
		<td align=right>Naziv:</td>
		<td><c:out value="${povl.naziv}" /></td>
	</tr>

	<tr>
		<td align=right>Tip:</td>
		<td><%=povl.getOp() == 1 ? "Procenat" : "Iznos"%>
	</tr>

	<tr>
		<td align=right>Vrednost:</td>
		<td><c:out value="${povl.vrednost}" /></td>
	</tr>


	<!-- dodajemo prazan red -->
	<tr>
		<td>&nbsp;</td>
		<td>&nbsp;</td>
	</tr>

	<tr>
		<td align="right"><a href="/admin?changeBenefit=true&ID=${povl.sifra.id}">Izmena</a></td>
		<td><a href="/admin?deleteBenefit=true&ID=${povl.sifra.id}">Brisanje</a></td>
	</tr>

</table>

<%
	} else {
%>

<p>Niste se prijavili! <br>
<a href="/logIn">Logovanje</a></p>

<%
	}
%>

<p><a href="/admin">Red voznje</a> <br>
<a href="/logIn?logOff=true">Odjava</a></p>

</body>
</html>